// Kony

#pragma once

#include "CoreMinimal.h"
#include "AbilitySystem/Abilitys/BaseDamageGameplayAbility.h"
#include "BaseBeamSpell.generated.h"

/**
 * 基础持续性 光束法术类 - 继承自基础伤害能力类
 */
UCLASS()
class GASC_HUANLING_API UBaseBeamSpell : public UBaseDamageGameplayAbility
{
	GENERATED_BODY()
public:
	//当前技能描述
	virtual FString GetDescription(int32 Level, const FText& Title, const FText& Description) override;
	//下一级技能描述
	virtual FString GetNextLevelDescription(int32 Level, const FText& Title, const FText& Description) override;
	//存储鼠标点击信息
	UFUNCTION(BlueprintCallable)
	void StoreMouseDataInfo(const FHitResult& HitResult);
	//存储玩家控制器和玩家角色Character
	UFUNCTION(BlueprintCallable)
	void StoreOwnerVariables();
	//计算获取法术碰到的第一个目标
	UFUNCTION(BlueprintCallable)
	void TraceFirstTarget(const FVector& BeamTargetLoction);
	//添加附近额外的目标 用于连锁
	UFUNCTION(BlueprintCallable)
	void StoreAdditionalTargets(TArray<AActor*>& OutAdditionalTarget);
	//主要目标是否死亡,蓝图可实现事件
	UFUNCTION(BlueprintImplementableEvent)
	void PrimaryTargetDied(AActor* DeadActor);
	//附加目标是否死亡,蓝图可实现事件
	UFUNCTION(BlueprintImplementableEvent)
	void AdditionalTargetDied(AActor* DeadActor);
	
private:
protected:
	//鼠标点击位置
	UPROPERTY(BlueprintReadWrite, Category = "Beam")
	FVector MouseHitLocation;
	//鼠标点击对象
	UPROPERTY(BlueprintReadWrite, Category = "Beam")
	TObjectPtr<AActor> MouseHitActor;
	//存储玩家控制器
	UPROPERTY(BlueprintReadWrite, Category = "Beam")
	TObjectPtr<APlayerController> OwnerPlayerController;
	//存储玩家角色Character
	UPROPERTY(BlueprintReadWrite, Category = "Beam")
	TObjectPtr<ACharacter> OwnerCharacter;
	//获取目标最大范围半径
	UPROPERTY(EditDefaultsOnly, Category = "Beam")
	float MaxTargetRange = 850.f;
	//最大连锁目标数量
	UPROPERTY(EditDefaultsOnly, Category = "Beam")
	int32 MaxNumShockTargets = 5;
};
